<?php
/**
 * Created by PhpStorm.
 * User: 氓羽
 * Date: 2018-4-13
 * Time: 15:33
 */
/*硬拷贝*/
class A{
    public $age = 0;
    public $username = "";
    public $obj =null;
}
class B{
    public $sex =0;
}

$a = new A();
$a->obj = new B();


$b = clone $a;
$b->obj->sex =1;

$b->age = 1;
var_dump($a->age);